<template>
  <category-item
    v-for="item of categories"
    :key="item._id"
    :title="item.name"
    :categoryId="item._id"
  ></category-item>
</template>

<script>
import { defineComponent } from "vue";

import { useCategories } from "../hooks/UseCategories";
import CategoryItem from "../components/CategoryItem.vue";

export default defineComponent({
  components: {
    CategoryItem,
  },
  setup() {
    const { categories, getCategories } = useCategories();
    return {
      categories,
      getCategories,
    };
  },
});
</script>

<style scoped></style>
